<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // let arr = [1, "周四含", 3, "将新华", "宋嘉乐"]
        // for (i = 0; i < arr.length; i++) {
        //     document.write(arr[i] + '<br>')
        // }

        // let k = 0
        // let arr =[4,8,8]
        // for (i=0;i<arr.length;i++){
        //     k+=arr[i]
        // }document.write(k, '<br>',k/arr.length,'<br>')

        // let b = 0
        // let a = 0
        // let k = 0
        // let arr =[[2,4,6],[4,6,8],[6,8,10]]
        // for (i=0;i<arr.length;i++){
        //     a=arr[i]
        //     for(l=0;l<a.length;l++){
        //         k+=a[l]
        //         b++
        //     }
        // }document.writeln(k, "<br>",k/b)       
        // console.log(b);
        
        // let a = 0
        // let k = 0
        // let arr =[[2,4,6],[4,6,8],[6,8,10]]
        // for(i=0;i<arr.length;i++){
        //     for(j=0;j<arr[i].length;j++){
        //         k+=arr[i][j]
        //         a++
        //     }
        // }document.writeln(k, "<br>",k/a)     

        let arr =[4,8,2,16]
        let max = arr[0]
        let min = arr[0]
        for(i=0;i<=arr.length;i++){
            if(arr[i]>max){
                max=arr[i]
            }else if(arr[i]<min){
                min=arr[i]
            }   
        }console.log(max,min);
        
        
        
    </script>
</body>

</html>